package model;

import java.util.ArrayList;
import java.util.List;

import common.DataManager;
import common.GridCoordinate;

/**
 * @author Colin
 * 
 * Type of automatic weapon with a square range of 5x5
 * a damage of 1, rate of 10 and speed of 2.
 *
 */

public class RapidFireTurret extends AutomaticWeapon{

		private static final int DEFAULT_COST = 4000;
		private static final int DEFAULT_RANGE_INT = 2;
		private static final int DEFAULT_RATE = 5;
		private static final int DEFAULT_DAMAGE = 1;
		private static final int DEFAULT_SPEED = 8;
		
		//RapidFireTurret without position
		public RapidFireTurret(){
			super( "Rapid Fire Turret", DataManager.RAPID_FIRE_TURRET, DataManager.RAPID_FIRE_TURRET_AMMO, DEFAULT_COST, DEFAULT_DAMAGE, DEFAULT_SPEED, DEFAULT_RANGE_INT, DEFAULT_RATE );
			
		}
		
		//RapidFireTurret wit position
		public RapidFireTurret( GridCoordinate position){
			super( "Rapid Fire Turret", DataManager.RAPID_FIRE_TURRET, DataManager.RAPID_FIRE_TURRET_AMMO, DEFAULT_COST, position, DEFAULT_DAMAGE, DEFAULT_SPEED, DEFAULT_RANGE_INT, DEFAULT_RATE );
			
			List<GridCoordinate> range = new ArrayList<GridCoordinate>();
			
			//Sets square range
			for( int i = -1*DEFAULT_RANGE_INT; i <= DEFAULT_RANGE_INT; ++i ){
				for( int j = -1*DEFAULT_RANGE_INT; j <= DEFAULT_RANGE_INT; ++j ){
					range.add( new GridCoordinate( position.getX() + i, position.getY() + j));
				}
			}
			setRange( range );
		}

		
		@Override
		public void rotateCCW() {
			//Square range so it stays the same
			
		}

		@Override
		public void createRange() {
			// TODO Auto-generated method stub
			
		}

		@Override
		public String getDescription() {
			return "The Rapid Fire Turret fires extremely quickly on all zombosaurs within a 2 tile radius.";
		}
		

}
